package what.basic.swingcommon;
import java.awt.*;
import java.awt.event.ActionEvent;

import javax.accessibility.Accessible;
import javax.accessibility.AccessibleContext;
import javax.swing.*;

import what.basic.basiccomponent.*;
public class swingaccesible {

	ImageIcon ico1=new ImageIcon("e:/1.jpg","picture1");
	ImageIcon ico2=new ImageIcon("e:/1.jpg","picture1");
	ImageIcon ico3=new ImageIcon("e:/1.jpg","picture1");
	ImageIcon ico4=new ImageIcon("e:/1.jpg","picture1");
	ImageIcon ico5=new ImageIcon("e:/1.jpg","picture1");
	JLabel lbl1=new JLabel(ico1);
	JLabel lbl2=new JLabel(ico2);
	JLabel lbl3=new JLabel(ico3);
	JLabel lbl4=new JLabel(ico4);
	JLabel lbl5=new JLabel(ico5);
	JButton b1=new JButton("bt1");
	JFrame f=new Jframe().jframe("border test", 400, 300, true);
	public void icon1(){
	//	JFrame f=new Jframe().jframe("border test", 400, 300, true);
		JPanel jp=new JPanel();
		f.setContentPane(jp);
		RedLineBorder border=new RedLineBorder();
		buttonAction ba=new buttonAction("actiontest");
		b1.setAction(ba);
		JButton b2=new JButton("dss");
		menuAction ma=new menuAction("exit");
		b2.setAction(ma);
		jp.setBorder(border);
		jp.add(lbl1);
		jp.add(lbl2);
		jp.add(lbl3);
		jp.add(lbl4);
		jp.add(lbl5);
		jp.add(b1);
		jp.add(b2);
	}
	public static void main(String[] args) {
		new swingaccesible().icon1();

	}
class buttonAction extends AbstractAction{
	public buttonAction(String text){
		super(text);
	}
	public void actionPerformed(ActionEvent arg0) {
		//
		if(arg0.getSource()==(Object)b1)
			lbl2.setText("xdddss");
		}
}	
class menuAction extends AbstractAction{
	public menuAction (String text){
		super(text);
	}
	public void actionPerformed(ActionEvent arg0) {
		int i=JOptionPane.showConfirmDialog(null,"exit ?","exit",JOptionPane.YES_NO_CANCEL_OPTION);
		System.out.println(i);
		if(i==0)
			f.dispose();
	}
}
class accessible implements Accessible{
	public AccessibleContext getAccessibleContext() {
		
		return null;
	}
	
}
}


